<template>
  <div>
    <GameCarousrl
      v-if="gamedata.allgame.length != 0"
      :data="gamedata.allgame"
    />
  </div>
</template>

<script>
import { getAllGames } from '@/apis/game'
import { reactive } from 'vue'
import GameCarousrl from '@/components/Home/GameCarousrl.vue'
export default {
  components: {
    GameCarousrl
  },
  setup() {
    let gamedata = reactive({
      allgame: []
    })
    const Created = () => {
      getAllGames().then((res) => {
        gamedata.allgame = res
        console.log('游戏列表', gamedata)
      })
    }
    Created()

    return {
      gamedata
    }
  }
}
</script>

<style></style>
